﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace EventPlanner.Models
{
    public class Contacto
    {   
        public string Nombre { get; set; }

        [DataType(DataType.PhoneNumber)]
        [RegularExpression(@"^\(\d{4,5}\) ?\d{8,9}|^\(\d{4,5}\) ?\d{6,7}",
                            ErrorMessage = "No es un número de teléfono válido. Ej: (#área) #(sin espacios)")]
        public string Telefono { get; set; }

        [Key]
        [Required(ErrorMessage = "El campo e-mail es obligatorio ")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"^[a-z0-9](([_\.\-]?[a-z0-9]+)*)@([a-z0-9]+)(([\.\-]?[a-z0-9]+)*)\.([a-z]{2,})$",
        ErrorMessage = "Email no válido")]
        [Display(Name = "Correo electrónico")]
        public string Email { get; set; }

        public virtual ICollection<Cuenta> Cuentas { get; set; }
    }
}